const express = require('express');
const router = express.Router();
const { auth } = require('../middleware/auth');
const {
  checkIn,
  getCheckInStatus,
  getCheckInHistory,
  getLeaderboard,
  updateCheckIn
} = require('../controllers/checkinController');

// 今日打卡
router.post('/', auth, checkIn);

// 获取打卡状态
router.get('/status', auth, getCheckInStatus);

// 获取打卡历史
router.get('/history', auth, getCheckInHistory);

// 获取排行榜
router.get('/leaderboard', getLeaderboard);

// 更新打卡记录
router.put('/:date', auth, updateCheckIn);

module.exports = router; 